package com.woniu.p2p.controller;

import com.woniu.p2p.entity.UserBank;
import com.woniu.p2p.service.MyBankSetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/userbank")
public class P2PMyBankSetController {

    @Autowired
    MyBankSetService myBankSetService;

    @RequestMapping("/allmybank")
    public List<UserBank> findAllUserBank(HttpServletRequest request){
        String token = request.getHeader("token");
        int i = Integer.parseInt(token);
        List<UserBank> allUserBank = myBankSetService.findAllUserBank(i);
        return allUserBank;
    }


}
